package com.shuda.business.channel.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * 分发规则实体类
 */
@Data
@TableName("t_distribution_rule")
@Schema(name = "DistributionRuleEntity", description = "分发规则实体")
public class DistributionRuleEntity {

    @TableId(value = "id", type = IdType.AUTO)
    @Schema(description = "主键ID")
    private Long id;

    @Schema(description = "分发方案ID")
    private Long schemeId;

    @Schema(description = "规则类型(region-地域,product_type-产品类型,customer_profile-客户画像)")
    private String ruleType;

    @Schema(description = "规则名称")
    private String ruleName;

    @Schema(description = "规则条件(JSON)")
    private String ruleCondition;

    @Schema(description = "规则值")
    private String ruleValue;

    @Schema(description = "优先级")
    private Integer priority;

    @Schema(description = "状态(enabled-启用,disabled-禁用)")
    private String status;

    @Schema(description = "描述信息")
    private String description;

    @Schema(description = "创建人")
    private String createBy;

    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "创建时间")
    private LocalDateTime createTime;

    @Schema(description = "更新人")
    private String updateBy;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "更新时间")
    private LocalDateTime updateTime;

    @Schema(description = "删除标记(0-正常,1-删除)")
    @TableLogic
    private Integer deleted;
}